package com.atguigu.ssyx.activity.api;

import com.atguigu.ssyx.activity.service.CouponInfoService;
import com.atguigu.ssyx.common.result.Result;
import com.atguigu.ssyx.model.activity.CouponUse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 优惠券信息 小程序前端控制器
 * </p>
 *

 */
@RestController
@RequestMapping("api/activity")
public class CouponInfoApiController {



    @Autowired
    private CouponInfoService couponInfoService;



    // 领取优惠券
    //    url: api/activity/auth/getCouponInfo/
    //    method: 'get'
    @GetMapping("auth/getCouponInfo/{id}")
    public Result getCouponInfoList(@PathVariable Long id) {
        CouponUse couponUse = couponInfoService.getCouponInfoList(id);
        return Result.ok(couponUse);
    }

}
